const express = require('express')

const userinfoRouter = express.Router()

const handlerGetuserinfo = require('../router_handler/userinfo')

// 引入验证参数中间件
const expressJoi = require('@escook/express-joi')
// 引入验证规则
const {updateSchema, updatePassword} = require('../schema/user')

// 获取用户信息接口
userinfoRouter.get('/getUser', handlerGetuserinfo.getUser)
// 修改用户信息接口
userinfoRouter.post('/updateUser', expressJoi(updateSchema), handlerGetuserinfo.updateUser)
// 修改密码接口
userinfoRouter.post('/updatePassword', expressJoi(updatePassword), handlerGetuserinfo.updatePassword)

module.exports = userinfoRouter